import http from "@/http";
import type { StoriesLatest, StoriesType, StoryData } from "@/selectTypings"

export const Api = {
  getStoriesLatest: (ur:string) => {
    return http.request<StoriesLatest>({
      url: ur,
      method: 'get'
    })
  },

  getStoriesBefore: (date: string) => {
    return http.request<StoriesType>({
      url: '/stories/before/' + date,
      method: 'get'
    })
  },

  getCurrentStory: (date: string) => {
    return http.request<{
      story: StoryData
    }>({
      url: '/story/' + date,
      method: 'get'
    })
  },

}